﻿using System;

namespace JinianNet.JNCms.Models
{
    public class Users
    {
        private int _id=0;
        private int _groupid=0;
        private int _usertype=0;
        private string _username=string.Empty;
        private string _account = string.Empty;
        private string _nickname = string.Empty;
        private string _userpassword = string.Empty;
        private string _question = string.Empty;
        private string _answer = string.Empty;
        private string _email = string.Empty;
        private int _sex=0;
        private DateTime _regtime=DateTime.Now;
        private DateTime _jointime=DateTime.Now;
        private int _logincount=0;
        private DateTime _lastlogintime=DateTime.Now;
        private DateTime _lastpresenttime=DateTime.Now;
        private string _lastloginip = string.Empty;
        private DateTime _lastpasswordchangedtime=DateTime.Now;
        private DateTime _lastlockouttime=DateTime.Now;
        private int _failedpasswordattemptcount=0;
        private DateTime _firstfailedpasswordattemptime=DateTime.Now;
        private int _failedpasswordanswerattempcount=0;
        private DateTime _firstfailedpasswordanswerattemptime=DateTime.Now;
        private int _status=0;
        private bool _enableresetpassword=false;
        private string _userface = string.Empty;
        private int _facewidth=0;
        private int _faceheight=0;
        private string _sign = string.Empty;
        private int _privacysetting=0;
        private decimal _balance=0;
        private int _userpoint=0;
        private int _userexp=0;
        private DateTime _endtime=DateTime.Now;
        private bool _isinheritgrouprole=false;
        private string _userpermission = string.Empty;
        private string _getpasswordsid = string.Empty;
        private DateTime _getpasswordtime=DateTime.Now;
        private int _honortype=0;
        private string _idcard=string.Empty;
        private DateTime _currentlogintime=DateTime.Now;
        private string _currentloginip=string.Empty;
        private bool _isadministrator = false;

        /// <summary>
        /// 
        /// </summary>
        public int ID
        {
            set { _id = value; }
            get { return _id; }
        }
        /// <summary>
        /// 
        /// </summary>
        public int GroupID
        {
            set { _groupid = value; }
            get { return _groupid; }
        }
        /// <summary>
        /// 会员类别
        /// </summary>
        public int UserType
        {
            set { _usertype = value; }
            get { return _usertype; }
        }
        /// <summary>
        /// 用户真名
        /// </summary>
        public string UserName
        {
            set { _username = value; }
            get { return _username; }
        }
        /// <summary>
        /// 用户帐号
        /// </summary>
        public string Account
        {
            set { _account = value; }
            get { return _account; }
        }
        /// <summary>
        /// 用户昵称
        /// </summary>
        public string NickName
        {
            set { _nickname = value; }
            get { return _nickname; }
        }
        /// <summary>
        /// 用户密码
        /// </summary>
        public string UserPassword
        {
            set { _userpassword = value; }
            get { return _userpassword; }
        }
        /// <summary>
        /// 问题
        /// </summary>
        public string Question
        {
            set { _question = value; }
            get { return _question; }
        }
        /// <summary>
        /// 答案
        /// </summary>
        public string Answer
        {
            set { _answer = value; }
            get { return _answer; }
        }
        /// <summary>
        /// 邮箱
        /// </summary>
        public string Email
        {
            set { _email = value; }
            get { return _email; }
        }
        /// <summary>
        /// 性别 0 男 1 女
        /// </summary>
        public int Sex
        {
            set { _sex = value; }
            get { return _sex; }
        }
        /// <summary>
        /// 注册时间
        /// </summary>
        public DateTime RegTime
        {
            set { _regtime = value; }
            get { return _regtime; }
        }
        /// <summary>
        /// 加入某用户组的时间
        /// </summary>
        public DateTime JoinTime
        {
            set { _jointime = value; }
            get { return _jointime; }
        }
        /// <summary>
        /// 登录次数
        /// </summary>
        public int LoginCount
        {
            set { _logincount = value; }
            get { return _logincount; }
        }
        /// <summary>
        /// 最后登录时间
        /// </summary>
        public DateTime LastLoginTime
        {
            set { _lastlogintime = value; }
            get { return _lastlogintime; }
        }
        /// <summary>
        /// 最后赠送积分时间，用于每次登录赠送积分的设置
        /// </summary>
        public DateTime LastPresentTime
        {
            set { _lastpresenttime = value; }
            get { return _lastpresenttime; }
        }
        /// <summary>
        /// 最后登录IP
        /// </summary>
        public string LastLoginIP
        {
            set { _lastloginip = value; }
            get { return _lastloginip; }
        }
        /// <summary>
        /// 上次修改密码的时间
        /// </summary>
        public DateTime LastPasswordChangedTime
        {
            set { _lastpasswordchangedtime = value; }
            get { return _lastpasswordchangedtime; }
        }
        /// <summary>
        /// 上次被锁定的时间
        /// </summary>
        public DateTime LastLockoutTime
        {
            set { _lastlockouttime = value; }
            get { return _lastlockouttime; }
        }
        /// <summary>
        /// 使用无效密码登录的次数，正确登录后置为0 
        /// </summary>
        public int FailedPasswordAttemptCount
        {
            set { _failedpasswordattemptcount = value; }
            get { return _failedpasswordattemptcount; }
        }
        /// <summary>
        /// 最后使用无效密码登录的时间
        /// </summary>
        public DateTime LastFailedPasswordAttempTime
        {
            set { _firstfailedpasswordattemptime = value; }
            get { return _firstfailedpasswordattemptime; }
        }
        /// <summary>
        /// 使用无效答案找回密码的次数
        /// </summary>
        public int FailedPasswordAnswerAttempCount
        {
            set { _failedpasswordanswerattempcount = value; }
            get { return _failedpasswordanswerattempcount; }
        }
        /// <summary>
        /// 最后使用无效答案找回密码的时间
        /// </summary>
        public DateTime LastFailedPasswordAnswerAttempTime
        {
            set { _firstfailedpasswordanswerattemptime = value; }
            get { return _firstfailedpasswordanswerattemptime; }
        }
        /// <summary>
        /// 用户状态。0－－正常，1－－锁定，101－－未通过邮件验证，102－－未通过管理员认证 103－－未通过手机验证
        /// </summary>
        public int Status
        {
            set { _status = value; }
            get { return _status; }
        }
        /// <summary>
        /// 是否允许用户修改密码
        /// </summary>
        public bool EnableResetPassword
        {
            set { _enableresetpassword = value; }
            get { return _enableresetpassword; }
        }
        /// <summary>
        /// 用户头像
        /// </summary>
        public string UserFace
        {
            set { _userface = value; }
            get { return _userface; }
        }
        /// <summary>
        /// 头像宽度
        /// </summary>
        public int FaceWidth
        {
            set { _facewidth = value; }
            get { return _facewidth; }
        }
        /// <summary>
        /// 头像高度
        /// </summary>
        public int FaceHeight
        {
            set { _faceheight = value; }
            get { return _faceheight; }
        }
        /// <summary>
        /// 用户签名
        /// </summary>
        public string Sign
        {
            set { _sign = value; }
            get { return _sign; }
        }
        /// <summary>
        /// 隐私设置
        /// </summary>
        public int PrivacySetting
        {
            set { _privacysetting = value; }
            get { return _privacysetting; }
        }
        /// <summary>
        /// 资金余额
        /// </summary>
        public decimal Balance
        {
            set { _balance = value; }
            get { return _balance; }
        }
        /// <summary>
        /// 用户点券数
        /// </summary>
        public int UserPoint
        {
            set { _userpoint = value; }
            get { return _userpoint; }
        }
        /// <summary>
        /// 用户积分
        /// </summary>
        public int UserExp
        {
            set { _userexp = value; }
            get { return _userexp; }
        }
        /// <summary>
        /// 过期时间
        /// </summary>
        public DateTime EndTime
        {
            set { _endtime = value; }
            get { return _endtime; }
        }
        /// <summary>
        /// 是否继承用户组权限
        /// </summary>
        public bool IsInheritGroupRole
        {
            set { _isinheritgrouprole = value; }
            get { return _isinheritgrouprole; }
        }
        /// <summary>
        /// 用户权限
        /// </summary>
        public string UserPermission
        {
            set { _userpermission = value; }
            get { return _userpermission; }
        }
        /// <summary>
        /// 取回密码随机串
        /// </summary>
        public string GetPasswordSid
        {
            set { _getpasswordsid = value; }
            get { return _getpasswordsid; }
        }
        /// <summary>
        /// 通过成密码字符串的时间
        /// </summary>
        public DateTime GetPasswordTime
        {
            set { _getpasswordtime = value; }
            get { return _getpasswordtime; }
        }
        /// <summary>
        /// 用户头衔
        /// </summary>
        public int HonorType
        {
            set { _honortype = value; }
            get { return _honortype; }
        }

        /// <summary>
        /// 证件号码
        /// </summary>
        public string IDCard
        {
            set { _idcard = value; }
            get { return _idcard; }
        }

        /// <summary>
        /// 当前登陆时间
        /// </summary>
        public DateTime CurrentLoginTime
        {
            set { _currentlogintime = value; }
            get { return _currentlogintime; }
        }

        /// <summary>
        /// 当前登陆IP
        /// </summary>
        public string CurrentLoginIP
        {
            set { _currentloginip = value; }
            get { return _currentloginip; }
        }

        /// <summary>
        /// 是否管理员
        /// </summary>
        public bool IsAdministrator{
            set { _isadministrator = value; }
            get { return _isadministrator; }
        }



        public static string GetStatusName(int status)
        {
            switch (status)
            {
                case 0:
                    return "正常 ";
                case 1:
                    return "已锁定";
                case 101:
                    return "未通过邮件验证";
                case 102:
                    return "未通过管理员认证";
                case 103:
                    return "未通过手机验证";
                default:
                    return "状态异常";
            }
        }
    }
}
